type
  TBarcodeFormat = (foUnknown,
    foAztec, foCodabar, foCode128, foCode39, foCode93,
    foDataMatrix, foEan13, foEan8, foItf, foPdf417,
    foQrCode, foTezCode,  foUpcA, foUpcE, foYtCode);

  TBarcodeFormats = set of TBarcodeFormat;

  TResult = record
    Bounds: TRect;
    Bytes: TArray<Byte>; // raw bytes
    Confidence: Double;
    Corners: array of TPoint;
    Format: TBarcodeFormat;
    Recognized: Boolean;
    Text: string;
    Value: string; // raw value
  end;

  TResults = TArray<TResult>;

  TBarcodeScanner = class
    constructor Create;
    function Recognize(const Bitmap: TBitmap): TResults;

    property CodabarMinLength: Integer read write;
    property CodabarMinLines: Integer read write;
    property Code128MinLength: Integer read write;
    property Code128MinLines: Integer read write;
    property Code39CheckDigit: Boolean read write;
    property Code39ExtendedMode: Boolean read write;
    property Code39MinLength: Integer read write;
    property Code39MinLines: Integer read write;
    property Code93MinLength: Integer read write;
    property Code93MinLines: Integer read write;
    property Ean13UpcaMinLines: Integer read write;
    property Ean8MinLines: Integer read write;
    property Formats: TBarcodeFormats read write; // barcode formats to be recognized
    property ItfMinLength: Integer read write;
    property ItfMinLines: Integer read write;
    property Unrecognized: Boolean read write; // output unrecognized barcodes
    property UpceMinLines: Integer read write;
  end;
